﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace BusinessObjects
{
#if Silverlight
    [Serializable]
#else
    [DataContract]
#endif
    public class BinsUpdateMessage : BaseBusinessObject
    {
        private RubbishRemovalStatus messageStatus;

        private int rubbishId;
        private int rubbishGridX;
        private int rubbishGridY;

        private int playerId;
        private int materialTypeId;

        public BinsUpdateMessage()
        {
        }

        public BinsUpdateMessage( Player player, Rubbish rubbish, RubbishRemovalStatus status )
        {
            this.PlayerId = player.Id;
            this.MaterialTypeId = rubbish.MaterialTypeId;
            this.RubbishId = rubbish.Id;
            this.RubbishGridX = rubbish.GridX;
            this.RubbishGridY = rubbish.GridY;
            this.MessageStatus = status;
        }

        [DataMember]
        public RubbishRemovalStatus MessageStatus
        {
            get
            {
                return this.messageStatus;
            }
            set
            {
                if ( this.messageStatus == value )
                    return;

                this.messageStatus = value;
            }
        }

        [DataMember]
        public int MaterialTypeId
        {
            get
            {
                return this.materialTypeId;
            }
            set
            {
                if ( this.materialTypeId == value )
                    return;

                this.materialTypeId = value;
            }
        }

        [DataMember]
        public int RubbishId
        {
            get
            {
                return this.rubbishId;
            }
            set
            {
                if ( this.rubbishId == value )
                    return;

                this.rubbishId = value;
            }
        }

        [DataMember]
        public int PlayerId
        {
            get
            {
                return this.playerId;
            }
            set
            {
                if ( this.playerId == value )
                    return;

                this.playerId = value;
            }
        }

        [DataMember]
        public int RubbishGridX
        {
            get
            {
                return this.rubbishGridX;
            }
            set
            {
                if ( this.rubbishGridX == value )
                    return;

                this.rubbishGridX = value;
            }
        }

        [DataMember]
        public int RubbishGridY
        {
            get
            {
                return this.rubbishGridY;
            }
            set
            {
                if ( this.rubbishGridY == value )
                    return;

                this.rubbishGridY = value;
            }
        }
    }
}
